{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Batch Prediction Using the Transfer-learned PhaseNet\n",
    "## 1. Download demo data\n",
    "```bash\n",
    "cd TLPN\n",
    "wget https://github.com/JUNZHU-SEIS/TLPN/releases/download/1.0.0/test_data.tar\n",
    "unzip test_data.zip\n",
    "```\n",
    "## 2. Run batch prediction\n",
    "TLPN currently only supports numpy format\n",
    "```bash\n",
    "python tlpn/picksegmentednpz.py --data_list=dataset/waveform.csv --data_dir=dataset/waveform_pred --result_dir=results --model=model/tlstead.pt\n",
    "```\n",
    "## 3. Visualize the responses of 5 different PhaseNet models (retrain, scedc, tlscedc, stead, tlstead)\n",
    "```bash\n",
    "python tlpn/visualizeresponses.py --data_list=dataset/waveform.csv --data_dir=dataset/waveform_pred --model_dir=model\n",
    "```\n",
    "<br>\n",
    "Note: the default number of workers is 20 for both scripts above, you may need to modify it for your PC or server (More workers mean higher IO speed). You can change it by\n",
    "\n",
    "```bash\n",
    "python tlpn/pick.py --data_list=dataset/waveform.csv --data_dir=dataset/waveform_pred --result_dir=results --model=model/tlstead.pt --num_workers=8\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {},
    "version_major": 1,
    "version_minor": 0
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
